package com.lusoft.onepiece.monster;

import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.region.ITiledTextureRegion;
import org.andengine.ui.activity.BaseGameActivity;

public class MonsterRegion {

	private ITiledTextureRegion monsterRegion;
	
	private Monster monster;
	
	public MonsterRegion(BaseGameActivity activity, float x, float y, int width, int height, String picture){
		BitmapTextureAtlas monsterTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), width, height, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
		monsterRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(monsterTextureAtlas, activity, picture, 0, 0, 3, 4);
		monster = new Monster(x, y, monsterRegion, activity.getVertexBufferObjectManager());
		monsterTextureAtlas.load();
	}
	
	public ITiledTextureRegion getMonsterRegion() {
		return monsterRegion;
	}

	public Monster getMonster() {
		return monster;
	}
	
}
